        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>Shape abstract class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="Shape">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/Shape.html">Shape</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>Shape</strong>
          abstract class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
abstract class Shape {
 /** The type of shape. Either circle or polygon. */
 int type;

 /** Shape radius. */
 num radius;

 /**
  * Constructs a new shape of unknown type.
  */
 Shape([int type = ShapeType.UNKNOWN, num radius = 0]) :
   type = type,
   radius = radius { }

 /**
  * Test a point for containment in this shape. This only works for convex
  * shapes.
  * transform:  the shape world transform.
  * point: a point in world coordinates.
  */
 bool testPoint(Transform transform, vec2 point);

 /**
  * Computes the associated axis aligned bounding box for a child shape
  * given a transform. Returns through the given out paramater.
  */
 void computeAxisAlignedBox(AxisAlignedBox box, Transform transform);

 /**
  * Computes (and returns through the given out parameter massData) the mass
  * properties of this shape using its dimensions and the
  * given density. The inertia tensor is computed about the local origin.
  */
 void computeMass(MassData massData, num density);

 /** Returns a clone of this shape. */
 Shape clone();
}
</pre>
</div>
<h3>Subclasses</h3>
<p>
<span class="type-box"><span class="icon-class"></span><a href="../box2d/CircleShape.html">CircleShape</a></span>, <span class="type-box"><span class="icon-class"></span><a href="../box2d/PolygonShape.html">PolygonShape</a></span></p>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="Shape">
<button class="show-code">Code</button>
new <strong>Shape</strong>([int type = ShapeType.UNKNOWN, num radius = 0]) <a class="anchor-link" href="#Shape"
              title="Permalink to Shape.Shape">#</a></h4>
<div class="doc">
<p>Constructs a new shape of unknown type.</p>
<pre class="source">
Shape([int type = ShapeType.UNKNOWN, num radius = 0]) :
 type = type,
 radius = radius { }
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="radius">
<button class="show-code">Code</button>
num         <strong>radius</strong> <a class="anchor-link"
            href="#radius"
            title="Permalink to Shape.radius">#</a>
        </h4>
        <div class="doc">
<pre class="source">
radius
</pre>
</div>
</div>
<div class="field"><h4 id="type">
<button class="show-code">Code</button>
int         <strong>type</strong> <a class="anchor-link"
            href="#type"
            title="Permalink to Shape.type">#</a>
        </h4>
        <div class="doc">
<pre class="source">
type
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="clone">
abstract <a href="../box2d/Shape.html">Shape</a> <strong>clone</strong>() <a class="anchor-link" href="#clone"
              title="Permalink to Shape.clone">#</a></h4>
<div class="doc">
<p>Returns a clone of this shape. </p>
</div>
</div>
<div class="method"><h4 id="computeAxisAlignedBox">
abstract void <strong>computeAxisAlignedBox</strong>(<a href="../box2d/AxisAlignedBox.html">AxisAlignedBox</a> box, <a href="../box2d/Transform.html">Transform</a> transform) <a class="anchor-link" href="#computeAxisAlignedBox"
              title="Permalink to Shape.computeAxisAlignedBox">#</a></h4>
<div class="doc">
<p>Computes the associated axis aligned bounding box for a child shape
given a transform. Returns through the given out paramater.</p>
</div>
</div>
<div class="method"><h4 id="computeMass">
abstract void <strong>computeMass</strong>(<a href="../box2d/MassData.html">MassData</a> massData, num density) <a class="anchor-link" href="#computeMass"
              title="Permalink to Shape.computeMass">#</a></h4>
<div class="doc">
<p>Computes (and returns through the given out parameter massData) the mass
properties of this shape using its dimensions and the
given density. The inertia tensor is computed about the local origin.</p>
</div>
</div>
<div class="method"><h4 id="testPoint">
abstract bool <strong>testPoint</strong>(<a href="../box2d/Transform.html">Transform</a> transform, <a href="../vector_math/vec2.html">vec2</a> point) <a class="anchor-link" href="#testPoint"
              title="Permalink to Shape.testPoint">#</a></h4>
<div class="doc">
<p>Test a point for containment in this shape. This only works for convex
shapes.
transform:  the shape world transform.
point: a point in world coordinates.</p>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
